﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using YSC_Services.BLL.Services.Interfaces;

namespace YSC_Backstage_Web.Controllers
{
    /// <summary>
    /// 市场价格
    /// </summary>
    public class MarketPriceController : Controller
    {
        private IComprehensivePriceBackstageServices _rep;
        private IBasisBackstageServices _bep;

        public MarketPriceController(IComprehensivePriceBackstageServices rep, IBasisBackstageServices bep)
        {
            this._rep = rep;
            this._bep = bep;
        }

        /// <summary>
        /// 市场 鱼种
        /// </summary>
        /// <returns></returns>
        public IActionResult DailyList()
        {
            return View();
        }

        public IActionResult List()
        {
            return View();
        }

        /// <summary>
        /// 地区树
        /// </summary>
        /// <returns></returns>
        public JsonResult GetAreaTreeAll(string name)
        {
            var ret = _bep.GetAreaTreeAll(name);
            return Json(ret);
        }

        /// <summary>
        /// 鱼种树
        /// </summary>
        /// <returns></returns>
        public JsonResult GetFishTreeAll()
        {
            var ret = _bep.GetFishTreeAll();
            return Json(ret);
        }

        /// <summary>
        /// 市场价格
        /// </summary>
        /// <param name="index">页码</param>
        /// <param name="size">页数量</param>
        /// <param name="fishType">鱼种类别</param>
        /// <param name="fishName">鱼种名称</param>
        /// <param name="areName">地区</param>
        /// <param name="startDate">开始时间</param>
        /// <param name="endDate">结束时间</param>
        /// <param name="sasearch">模糊条件</param>
        /// <returns></returns>
        public JsonResult MarketPriceAll(int index, int size, string fishType, string dataType, string fishName, string areName, string areCode, string dateMonth, string startDate, string endDate, string sasearch)
        {
            var ret = _rep.MarketPriceAll(index, size, fishType, dataType, fishName, areName, areCode, dateMonth, startDate, endDate, sasearch);
            return Json(ret);
        }

        /// <summary>
        /// 市场价格 鱼种
        /// </summary>
        /// <param name="dateYears"></param>
        /// <param name="fishName"></param>
        /// <param name="areName"></param>
        /// <returns></returns>
        public JsonResult MarketFishYearsAll(string dateYears, string fishName, string areName, string areCode)
        {
            var ret = _rep.MarketFishYearsAll(dateYears, fishName, areName, areCode);
            return Json(ret);
        }
    }
}